import {AbstractSearchArgument} from '../global'
import { CONDITION_TYPE, DATE_PICKER_SHOW_TYPE } from '@/utils/constants'
import moment from 'moment'

let time = []
time[0] = moment().format('YYYY-MM-01')
time[1] = moment().format('YYYY-MM-DD')
const SEARCH_CONDITION = [
  {
    name: 'time',
    title: '日期范围',
    placeholder: '',
    type: CONDITION_TYPE.DATE,
    value: time,
    visible: true,
    config: {
      type: DATE_PICKER_SHOW_TYPE.DATE_RANGE,
      format: 'yyyy-MM-dd',
      valueFormat: 'yyyy-MM-dd'
    }
  },
  {
    name: 'pageTitle',
    title: '页面名',
    placeholder: '--页面--',
    type: CONDITION_TYPE.SELECT,
    value: '',
    visible: true,
    config: {
      list: [
        {value: '品牌优化', label: '品牌优化'},
        {value: '视觉营销', label: '视觉营销'}
      ]
    }
  }, {
    name: 'pageItemTitle',
    title: '页面项目名',
    placeholder: '--页面项目名--',
    type: CONDITION_TYPE.SELECT,
    value: '',
    visible: true,
    config: {
      list: [
        {value: '新闻营销', label: '新闻营销'},
        {value: '相关下拉炒作', label: '相关下拉炒作'},
        {value: '站外推广', label: '站外推广'},
        {value: '网站建设', label: '网站建设'},
        {value: '微营销系统', label: '微营销系统'},
        {value: '画册VI设计', label: '画册VI设计'}
      ]
    }
  }
]

class SearchArgument extends AbstractSearchArgument {
  constructor () {
    super()
    this.startTime = ''
    this.endTime = ''
    this.pageTitle = ''
    this.pageItemTitle = ''
  }
}

export {
  SEARCH_CONDITION,
  SearchArgument

}
